package com.anti_poverty_detection_system.springboot.service.impl;

import com.anti_poverty_detection_system.springboot.model.Roles;
import com.anti_poverty_detection_system.springboot.mapper.RolesMapper;
import com.anti_poverty_detection_system.springboot.service.IRolesService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ZITONG BAI
 * @since 2024-06-17
 */
@Service
public class RolesServiceImpl extends ServiceImpl<RolesMapper, Roles> implements IRolesService {

    @Autowired
    RolesMapper rolesMapper;
    public Roles getRoleByRoleName(String roleName){
        QueryWrapper<Roles> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("role_name",roleName);
        return rolesMapper.selectOne(queryWrapper);
    }

}
